package com.dodo.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.dodo.domain.User;
import com.dodo.service.UserService;

@Controller
@RequestMapping("/user")
public class UserController {

	@Resource
	private UserService userService;

	@RequestMapping("/showUser")
	public String toIndex(User user, Model model) {
		Integer userId = user.getId();
		User result = userService.getUserById(userId);
		model.addAttribute("user", result);
		return "showUser";
	}
}
